package common.table;
import haxe.ds.IntMap;
import haxe.ds.StringMap;
import lovedna.resource.ITableSet;
import common.table.data.TableDataActor;
class TableActor implements ITableSet
{
	public var name:String;
	private var __list:Array<TableDataActor>;
	private var __intMap:IntMap<TableDataActor>;
	private var __stringMap:StringMap<TableDataActor>;
	public function new()
	{
		name = "actor"; __list = [];
	}
	public function createTableItem():TableDataActor
	{
		var item:TableDataActor = {};
		if (__list != null)
		{
			__list.push(item);
		}
		return item;
	}
	@:keep
	private function indexByInt(key:Int, item:Dynamic):Void
	{
		if (__intMap == null)
		{
			__intMap = new IntMap<TableDataActor>();
		}
		__intMap.set(key, item);
	}
	@:keep
	private function indexByString(key:String, item:Dynamic):Void
	{
		if (__stringMap == null)
		{
			__stringMap = new StringMap<TableDataActor>();
		}
		__stringMap.set(key, item);
	}
	public function getByInt(key:Int):TableDataActor
	{
		if (__intMap == null)
		{
			return null;
		}
		return __intMap.get(key);
	}
	public function getByString(key:String):TableDataActor
	{
		if (__stringMap == null)
		{
			return null;
		}
		return __stringMap.get(key);
	}
	public function getAll():Array<TableDataActor>
	{
		return __list;
	}
	public function tableInit():Void 
	{
		if (__list == null) return;
		var len:Int = __list.length;
		for (i in 0...len)
		{
			addItem(__list[i]);
		}
		//__list = null;
	}
	public dynamic function addItem(value:TableDataActor):Void
	{
		
	}
}